package org.wheel;

import net.sf.jsqlparser.expression.ExpressionVisitorAdapter;
import net.sf.jsqlparser.expression.StringValue;
import net.sf.jsqlparser.schema.Column;

import java.util.ArrayList;
import java.util.List;

public class ColumnCollector extends ExpressionVisitorAdapter{

    private final List<String> columns = new ArrayList<>();

    public List<String> getColumns() {
        return columns;
    }

    @Override
    public void visit(Column column) {
        System.out.println("Found column: " + column.getColumnName());
        columns.add(column.getColumnName());
    }

    @Override
    public void visit(StringValue value) {
        System.out.println("Found string: " + value.getValue());
    }
}
